﻿@using QuocHoi_TV_Frontend.Models
@model List<QuocHoi_TV_Frontend.Models.News>
@{
    ViewBag.Title = "Detail";
    Layout = "~/Views/Shared/_Broadcast.cshtml";
    List<Category> lstCate = DataModels.GetCateHaveNews(10);
    List<News> topVideo = ViewBag.lstVideoNew;
   
}
<section id="content">
	<div class="box_tv_live">
		<div class="tile_box_tv_live">
			<div class="link_cata">
				@topVideo[0].Category.CateName
			</div>
			<div class="quickfind">
				<p>Tìm nhanh</p>
				<div class="boxquickfind">
					<select>
						<option>Chọn chuyên mục</option>
                        <option value="~/Default">Trang chủ</option> 
                        @foreach (var item in lstCate)
                        {
                            <option value="@item.CateID">@item.CateName</option>    
                        }											
					</select>
				</div>
			</div>
		</div>
		<div class="newsinday">
			<div class="tile_nid">
				Tin @topVideo[0].Category.CateName trong ngày
			</div>
			<div class="hour_day">
				@Html.Raw(UtilDate.FormatDateVN(DateTime.Parse(DateTime.Now.ToString())))
			</div>
			<div class="box_nid" id="lstVideo">
                @{
                    int count = 0;
                }
				<ul>
                    @foreach (var top in topVideo)
                    {
                        string linkDetail = Url.RouteUrl("BroadCastDetail",
                                            new
                                            {
                                                controller = "Broadcast",
                                                action = "VideoDetail",
                                                cate_name = Util.RemoveSign4VietnameseString(top.Category.CateName),
                                                news_title = Util.RemoveSign4VietnameseString(top.NewsTitle),
                                                newsID = top.NewsID
                                            });
                        if(count > 0){
                            <li>
								<div class="imgvideo">									
									<img src="@top.PathImgSmall" width="90" height="60" style="cursor:pointer" onclick="loadVideo(@top.NewsID)">									
								</div>
								<span class="info_imgvideo" style="cursor:pointer" onclick="loadVideo(@top.NewsID)">@top.NewsTitle</span>
							</li>   
                        }
                        count++;
                    }
				</ul>
			</div>
			<div class="button_next_nid">
				<div class="btnext">
					<a class="icon_arow_nid" href="">											
					</a>
				</div>			
			</div>
		</div>
		<div class="monitor" id="ShowVideo">			
             @{ Html.RenderPartial("_VideoDetail", (News)ViewBag.video); }
		</div>
	</div>
    <div id="grid-list">
        @{ Html.RenderPartial("_ListVideo", Model); }
    </div>
	<!-- content all-->
	<div class="catavideos">
        @{List<Category> videoCate = ViewBag.lstCate;}
        @foreach (var item in videoCate)
        {
            string linkCate = Url.RouteUrl("BroadCastList",
                    new
                    {
                        controller = "Broadcast",
                        action = "Detail",
                        cate_name = Util.RemoveSign4VietnameseString(item.CateName),
                        cateID = item.CateID
                    });
            <div class="ttvideos">
                <div class="tile_ttvideos">
                    <a class="nametilevdieos" href="@Html.Raw(linkCate)">@item.CateName</a>
                    <a class="viewall_videos" href="@Html.Raw(linkCate)">Xem tất cả video @item.CateName</a>
                </div>
                <div class="show_ttvideos">
                    @{List<News> lstVideo = DataModels.GetNewsByCate(item.CateID, 5);}
                    <ul>
                        @foreach (var video in lstVideo)
                        {
                            string linkVideo = Url.RouteUrl("BroadCastDetail",
                                            new
                                            {
                                                controller = "Broadcast",
                                                action = "VideoDetail",
                                                cate_name = Util.RemoveSign4VietnameseString(video.Category.CateName),
                                                news_title = Util.RemoveSign4VietnameseString(video.NewsTitle),
                                                newsID = video.NewsID
                                            });
                            <li>
                                <div class="imgshow_ttvideos">
                                    <a href="@Html.Raw(linkVideo)">
                                        <img src="@video.PathImgSmall" width="144" height="81">
                                        <span class="iconplaysmall"></span>
                                        @video.NewsTitle
                                    </a>
                                </div>
                            </li>    
                        }
                    </ul>
                </div>
            </div>    
        }
	</div>
</section>
<script>
    // using jQuery
    $('video,audio').mediaelementplayer(/* Options */);
</script>
				